Script Examples
Thinking Home supports AppleScript with a complete dictionary, browsable with any script editor. What is not visible in the dictionary is that you can refer to devices in alternative ways. Just about any way will work. For example, the “turn on” examples below are all equivalent.
These are a few examples of AppleScript in Thinking Home.
Referring to a device |
-- You can work with devices any way you prefer tell application "Thinking Home"
turn on the "Porch Light"
end tellturn on "P16" turn on device "Porch Light" turn on device 3 tell the "Porch Light" of application "Thinking Home"
turn on
end telltell application "Thinking Home"
tell the "Porch Light"
end tell
turn on
end tell |
Dimming
|
-- Dimming and brightening is easy, too. tell application "Thinking Home"
dim the "Porch Light"-- default is by 35%
end tell
brighten the "Porch Light" by 80 -- percent dim the "Porch Light" to 20 -- percent |
Sunrise
|
tell application "Thinking Home"
set mySunUp to the sunrise for the current date
end tellset mySundown to the sunset for the current date |